import { container } from "tsyringe";
import { CLOUD_HOST, CLOUD_PORT, CLOUD_WEBVIEW_URL } from "../../tokens/index";
import { tryGet } from "../../utils/index";

export function commonRegister(){
    container.register(CLOUD_HOST, {
        useValue: `60.204.248.43`
    })
    container.register(CLOUD_PORT, {
        useValue: 3102
    });
    container.register(CLOUD_WEBVIEW_URL, {
        useFactory: () => {
            const cloudHost = tryGet(CLOUD_HOST)
            const cloudPort = tryGet(CLOUD_PORT)
            return `http://${cloudHost}:${cloudPort}/autojs/core/mobile/dev`
        }
    });
}